#include "sprite.h"

using namespace std;

Sprite::Sprite() {
    bm = NULL;
    px = 0;
    py = 0;
}

Sprite::Sprite(BITMAP* bmIn, int pxIn, int pyIn) {
    bm = bmIn;
    px = pxIn;
    py = pxIn;
}

Sprite::~Sprite(){
    destroy_bitmap(bm);
}

void Sprite::render(BITMAP* bmIn, int xIn, int yIn) {
    int topLeftX, topLeftY;
    topLeftX = xIn - px;
    topLeftY = yIn - py;
    draw_sprite(bmIn, bm, topLeftX, topLeftY);
}

void Sprite::render(BITMAP* bmIn, int xIn, int yIn, int angle) {
    pivot_sprite(bmIn, bm, xIn, yIn, px, py, angle);
}
/*
class Sprite {
    public:
        Sprite();
        Sprite(BITMAP*, int x, int y);


    private:
        BITMAP* bm;
        int px;
        int py;
}

*/
